package com.agp.mapper;


import com.agp.entity.TreeMedia;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TreeMediaMapper {

    // 批量插入图片
    void insert (List<String> urls, Integer treeId);

    // 根据古树id查询图片
    @Select("select media_url from tree_media where tree_id=#{treeId} limit 1")
    String selectByTreeId(Integer treeId);

    //  根据古树id查询所有图片
    @Select("select media_url from tree_media where tree_id=#{treeId}")
     List<String> selectByTreeIdList(Integer treeId);

    // 根据古树id删除图片

    void deleteByTreeId(Integer[] ids);

    // 批量插入图片
    void insertTreeMedia(List<TreeMedia> treeMediaList);

}
